package com.websocet.controller;

import com.websocet.service.SysUserService;
import lombok.SneakyThrows;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 陈玉鹏
 * @Description: TODO
 * @DateTime: 2023/4/20 19:38
 */
@RestController
public class TestAsync {

    private final SysUserService sysUserService;

    public TestAsync(SysUserService sysUserService) {
        this.sysUserService = sysUserService;
    }

    @SneakyThrows
    @GetMapping("/testAsync")
    public String test() {
        System.out.println("主线程开始");
        String test = sysUserService.test();
        long end = System.currentTimeMillis();
        System.out.println("主线程结束");
        return null;
    }

}
